
<?php include_once 'common/header.php';  ?>
<!-- admin_main -->
<div class="admin_main">
	<!-- Admin_top end -->
	<?php include_once 'common/site_left.php';  ?>
	<!-- Admin_Left End -->
	<div class="admin_right">
		<div class="admin_right_title">
			<strong>栏目管理</strong> &gt;&gt; 编辑文章
		</div>		
		<div class="admin_right_info">
			<form action="/ychadmin/article/edit/" method="post" id="articleForm" name="articleForm"  enctype="multipart/form-data">
			<input type="hidden" id="id" name="id" value="<?php echo $article['id'];?>" />
			<input type="hidden" id="bthumbnail" name="bthumbnail" value="<?php echo $article['thumbnail'];?>" />
			<div class="admin_right_info_title"><h2>编辑文章</h2></div>
			<ul>
				<li>
					<font color="red"><?php echo @validation_errors(); ?></font>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">标题：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="title" id="title" size="50"  value="<?php echo $article['title'];?>" />
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="titleTip"></div> </div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">所属栏目：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					
					<select id="nid" name="nid">
							<option value="0">--请选择栏目类型--</option>
							<?php if($site_array){
								foreach($site_array as $key=>$v){
									?>
							<option <?php if($key == $article['nid']){?> selected="selected" <?php }?> value="<?php echo $key;?>">
								<?php echo $v;?>
							</option>
								<?php
								}
							}
							?>
					</select>
					
						
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="paret_id" style="color:red;"></div> </div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">作者：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="author" id="author" size="50" value="<?php echo $article['author'];?>" />
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="authorTip"></div></div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">来源：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="fsource" id="fsource" size="50" value="<?php echo $article['fsource'];?>" />
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="fsourceTip"></div></div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">缩略图：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="file" name="thumbnail" id="thumbnail" /><img src="<?php echo ARTICLE_IMG.$article['thumbnail'];?>" width="60" height="60"  />
					</div>
					<div class="admin_right_info_tr admin_right_info_r"></div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">发布时间：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="ptime" id="ptime" value="<?php echo date('Y-m-d', $article['ptime']);?>" onfocus="WdatePicker()" class="Wdate"/>
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="ptimeTip"></div></div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">排序：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="forder" id="forder" value="<?php echo $article['forder'];?>" />
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="forderTip"></div></div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">摘要：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<textarea name="summary" id="summary" rows="5" cols="50"><?php echo $article['summary'];?></textarea>
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="summaryTip"></div></div>
				</li>
			</ul>
			<div class="admin_right_info_title" style="margin-top:20px;"><h2></h2></div>
			<ul>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">内容：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.config.js"></script>
    				<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.all.js"></script>
    				<script type="text/javascript" charset="utf-8">
				          var editor = new baidu.editor.ui.Editor();
				          editor.render('content');  //editor为编辑器容器的id
				      </script>
					<textarea name="content" id="content" style="width:800px">
					<?php echo $article['content'];?>
					</textarea>
					</div>
				</li>
				<li>
				<div class="admin_right_info_tr admin_right_info_l">&nbsp;</div>
				<div class="admin_right_info_tr admin_right_info_m"><input class="btn_b" type="submit" value="提交" style="margin-left:300px;"/></div>
					
				</li>
			</ul>
			</form>
			</div>
	</div>
<!-- Admin_Right End -->
</div>
<!-- admin_main end -->
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({formID:"articleForm",debug:false,submitOnce:true,
		onError:function(msg,obj,errorlist){
			$("#errorlist").empty();
			$.map(errorlist,function(msg){
				$("#errorlist").append("<li>" + msg + "</li>")
			});
			alert(msg);
		},
		submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...'
	});
	$("#title").formValidator({autoModify:true,onShow:"",onFocus:"标题在1-50个汉字之间",onCorrect:""}).inputValidator({min:1,max:50,onError:"标题不能为空,请确认"});
	$("#url").formValidator({autoModify:true,onShow:"",onFocus:"UEL在1-20个字符之间",onCorrect:""}).inputValidator({min:1,max:50,onError:"URL必须在1-20个字符之间,请确认"});
	$("#fgroup").formValidator({autoModify:true,onShow:"",onFocus:"组在0-20个字符之间",onCorrect:""}).inputValidator({min:0,max:50,onError:"组不能大于20个字符,请确认"});
	$("#forder").formValidator({autoModify:true,onShow:"",onFocus:"序号必须为数字",onCorrect:""}).inputValidator({min:0,max:99,type:"value",onErrorMin:"排序值必须为数字,请确认"});
});
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
</body>
</html>
